package chapter15;

/**
 * @author : DuJiabao
 * @Date : 2021/3/4 11:09
 * @Project : thinking_in_java
 * @File : null.java
 * @Desc :
 */
public class Holder3<T> {
  private T a;

  public Holder3(T a) {
    this.a = a;
  }

  public T getA() {
    return a;
  }

  public void setA(T a) {
    this.a = a;
  }

  public static void main(String[] args) {
    Holder3<Fruit> fruitHolder3 = new Holder3<Fruit>(new Fruit());
    Fruit a = fruitHolder3.getA();  // 无需强转，直接使用
  }
}

class Fruit {
  String name;
}
